<%# locals: post, content_label, button_text, button_submitting_text. %>
<%= form_for post,
             url: post.submit_path,
             as: :post,
             html: {
                 class: 'thredded--form thredded--post-form',
                 'data-thredded-post-form' => true,
                 'data-autocomplete-url' => autocomplete_users_path,
                 'data-autocomplete-min-length' => Thredded.autocomplete_min_length,
                 'data-thredded-submit-hotkey' => true,
             } do |form| %>
  <ul class="thredded--form-list">
    <%= render 'thredded/posts_common/form/content',
               form: form, content_label: content_label, preview_url: post.preview_path %>
    <li>
      <% button_submitting_text ||=
             post.persisted? ? t('thredded.form.update_btn_submitting') : t('thredded.form.create_btn_submitting') %>
      <button type="submit" class="thredded--form--submit" data-disable-with="<%= button_submitting_text %>">
        <%= button_text %>
      </button>
    </li>
  </ul>
<% end %>
